#include "samplingthread.h"

SamplingThread::SamplingThread(QObject *parent):
    QwtSamplingThread(parent)
{
}

void SamplingThread::sample(double elapsed)     //elapsed - время с момента запуска потока
{
    if(SignalData::instance().getFlag() == false)
    {
        qDebug()<< "SamplingThread::sample()  flag = false";
        SamplingThread::stop();
    }
    else
    {
    SignalData::instance().append(elapsed);
    }
    return;
}

void SamplingThread::setPath(const QString &path)
{
    SignalData::instance().setPath(path);
}

void SamplingThread::setNumConnection(int numConnetion)
{
    SignalData::instance().setNumConnection(numConnetion);
}

void SamplingThread::setCountParam(const int countParam)
{
    SignalData::instance().setCountParam(countParam);
}

void SamplingThread::init()
{
    SignalData::instance().initData();
}
void SamplingThread::stop()
{
    SignalData::instance().setFlag(true);
    QwtSamplingThread::stop();
    qDebug() <<"Samplingthread, после stop()";
}
